[#Part: CMP TallyShopFeatures Left]
	Add : Line  : 	 Enable_SelectedLineTotal
	
[Line : Enable_SelectedLineTotal]
	Field : medium prompt, Enable_SelectedLineTotal
    Local : Field : Medium Prompt 	: Set as 	: "Enable Selected Line Total ?"
    Local : Field : Medium Prompt 	: width 	: 35
  
	space top : 0.2 cm

[Field :  Enable_SelectedLineTotal]
   Use : Logical field
   Storage : Enable_SelectedLineTotal
   
[System : UDF]
	Enable_SelectedLineTotal	: Logical 	: 331

[System : Formula]
	Enable_SelectedLineTotal	: $Enable_SelectedLineTotal:Company:##SVCurrentCompany 


[#Form: Normal Day Book]
	Option	: vSelectedLineTotal_DaybookTotal : @@Enable_SelectedLineTotal
    
[!Form: vSelectedLineTotal_DaybookTotal]
	Add		: Part:At Beginning:SelectedLineTotal_DaybookTotal	

[Part: SelectedLineTotal_DaybookTotal]
  Line 		: SelectedLineTotal_DaybookTotal
  
  Vertical Align:Centre
  Horizontal Align:Centre
  
[line :SelectedLineTotal_DaybookTotal]
    Left Field : SelectedLineTotal_DebitAmt_Daybook,+
				 SelectedLineTotal_CreditAmt_Daybook,+
				 SelectedLineTotal_Closing_Daybook,+
				 SelectedLineTotal_NoofLine
				 
	Local	:	Field:Default : Style:Large Bold
	Local	:	Style:Large Bold :Height: 12
	
[#Line:DSP VchDetail]
	Option 	: SelectedLineTotal_DaybookTotalb : $$IsEmpty:##LedgerName AND @@Enable_SelectedLineTotal ;##VoucherTypeName = $$SysName:AllItems AND NOT $$IsEmpty:##LedgerName
		       	
[!Line:SelectedLineTotal_DaybookTotalb]  
    On 		: Focus : Yes : Call : SelectedLines_DrTotal_Daybook
	On 		: Focus : Yes : Call : SelectedLines_CrTotal_Daybook
	On 		: Focus : Yes : Call : SelectedLines_NetAmt_Daybook
	On 		: Focus : Yes : Call : SelectedLines_Daybook_NoofLine

[Function:SelectedLines_Daybook_NoofLine]
	0020 	: Set : SelectedLines_NoofLine 	: $$NumItems:SelectedLines_Daybook_NoofLine
	;0022 	: Set : IsSelected_Dr     		: (NOT $$IsEmpty:##SelectedLines_DrTotal)
	
[Collection:SelectedLines_Daybook_NoofLine]
	Data Source : Report : Selected
	Client Only : Yes
	
[Function:SelectedLines_DrTotal_Daybook]
	0020 	: Set : SelectedLines_DrTotal 	: ($$CollAmtTotal:CollDebitTotal_DayBook:$DaybookAmount)
	0022 	: Set : IsSelected_Dr     		: (NOT $$IsEmpty:##SelectedLines_DrTotal)
	
[Function:SelectedLines_CrTotal_Daybook]
	0020 	: Set : SelectedLines_CrTotal 	: ($$CollAmtTotal:CollCreditTotal_DayBook:$DaybookAmount)
	0022 	: Set : IsSelected_Cr     		: (NOT $$IsEmpty:##SelectedLines_CrTotal)   
	
[Function:SelectedLines_NetAmt_Daybook]
	0020 	: Set : SelectedLines_NetAmt  	: ($$CollAmtTotal:CollNetAmt_DayBook:$DaybookAmount)
	0022 	: Set : IsSelected_Cl    		: (NOT $$IsEmpty:##SelectedLines_NetAmt)

[Collection:CollNetAmt_DayBook]
	Data Source : Report : Selected
	Fetch       : Name, TotalLedVchAmt,DaybookAmount
	Client Only : Yes
		
[Collection:CollDebitTotal_DayBook]
	Data Source : Report : Selected
	Fetch       : Name,TotalLedDrVchAmt,DaybookAmount
    Client Only : Yes
	
	Filter 		: IsSelected_DebitBal_DayBook
		
[System:Formulae]
    IsSelected_DebitBal_DayBook : $$IsDr:$DaybookAmount
	
[Collection:CollCreditTotal_DayBook]
	Data Source : Report : Selected
	Fetch       : Name, TotalLedCrVchAmt,DaybookAmount
    Client Only : Yes
	
	Filter 		: IsSelected_CreditBal_DayBook
		
[System:Formulae]
	IsSelected_CreditBal_DayBook : NOT $$isDr:$DaybookAmount
	
[Field: SelectedLineTotal_DebitAmt_Daybook]
	Use     : Name Field
	Set as  : if ##IsSelected_Dr AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollDebitTotal_DayBook:$DaybookAmount) Then $$String:@SelectedTotalDr + $$String:@SelectedTotalValDr Else ""

	Invisible  : NOT $$InDisplayMode 
	
	;Color   : Blue	
	
	SelectedTotalDr    : $$LocaleString:"Debit Total : "
	SelectedTotalValDr : $$String:##SelectedLines_DrTotal:"DrCr"
	
	Width   : 28
	Align   : Centre
		
[Field:SelectedLineTotal_CreditAmt_Daybook]
	Use     : Name Field
	Set as  : if ##IsSelected_Cr AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollCreditTotal_DayBook:$DaybookAmount) Then $$String:@SelectedTotalCr + $$String:@SelectedTotalValCr Else ""

	Invisible          : NOT $$InDisplayMode
	
	Color   : Blue
	
	SelectedTotalCr    : $$LocaleString:"Credit Total : "
	SelectedTotalValCr : $$String:##SelectedLines_CrTotal:"DrCr"
	
	Width   : 28
	Align   : Centre
		
[Field: SelectedLineTotal_Closing_Daybook]
	Use     : Name Field
	Set as  : if ##IsSelected_Cl AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollNetAmt_DayBook:$DaybookAmount) Then $$String:@SelectedTotalnet + $$String:@SelectedTotalValnet Else ""
	
	Color   : Red
	
	Format  : "DrCr"
	
	Invisible          : NOT $$InDisplayMode
	
	SelectedTotalNet   : $$LocaleString:"Closing: "
	SelectedTotalValNet: $$String:##SelectedLines_NetAmt:"DrCr"
	
	Width   : 28
	Align   : Centre
	

[Field: SelectedLineTotal_NoofLine]
	Use     : Name Field
	Set as  : IF @SelectedTotalValNet = "0" THEN "" ELSE $$String:@SelectedTotalnet + $$String:@SelectedTotalValnet 
	;if ##IsSelected_Cl AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollNetAmt_DayBook:$DaybookAmount) Then $$String:@SelectedTotalnet + $$String:@SelectedTotalValnet Else ""
	
	Color   : Blue
	
	Format  : "DrCr"
	
	Invisible          : NOT $$InDisplayMode
	
	SelectedTotalNet   : $$LocaleString:"Selected Records : "
	SelectedTotalValNet: $$String:##SelectedLines_NoofLine
	
	Width   : 20
	Align   : Centre
	
[#Form: Normal Ledger]
	Option: SelectedLineTotal_DALTotal : @@Enable_SelectedLineTotal
    
[!Form: SelectedLineTotal_DALTotal]
	Add:Part:At Beginning: SelectedLineTotal_DALTotal	

[Part: SelectedLineTotal_DALTotal]
  Line : SelectedLineTotal_DALTotal
  Vertical Align:Centre
  Horizontal Align:Centre
		
[Line:SelectedLineTotal_DALTotal]  
	Add : Left Field :	SelectedLineTotal_DebitAmt,+
						SelectedLineTotal_CreditAmt,+
						SelectedLineTotal_Closing,+
						SelectedLineTotal_NoofLine

	Local	:	Field:Default : Style:Large Bold
	
	
[#Line:DSP VchDetail]
	Option : SelectedLineTotal_DALOpp : NOT $$IsEmpty:##LedgerName  AND @@Enable_SelectedLineTotal  ;##IsLedgerReport
		
[!Line:SelectedLineTotal_DALOpp]  
    On 		: Focus : Yes : Call : SelectedLines_DrTotal
	On 		: Focus : Yes : Call : SelectedLines_CrTotal
	On 		: Focus : Yes : Call : SelectedLines_NetAmt
	On 		: Focus : Yes : Call : SelectedLines_Daybook_NoofLine
		
[Function:SelectedLines_DrTotal]
	0020 	: Set : SelectedLines_DrTotal 	: ($$CollAmtTotal:CollDebitTotal_DAL:$TotalLedDrVchAmt)
	0022 	: Set : IsSelected_Dr     		: (NOT $$IsEmpty:##SelectedLines_DrTotal)
	
[Function:SelectedLines_CrTotal]
	0020 	: Set : SelectedLines_CrTotal 	: ($$CollAmtTotal:CollCreditTotall_DAL:$TotalLedCrVchAmt)
	0022 	: Set : IsSelected_Cr     		: (NOT $$IsEmpty:##SelectedLines_CrTotal)   
	
[Function:SelectedLines_NetAmt]
	0020 	: Set : SelectedLines_NetAmt  	: ($$CollAmtTotal:CollNetAmt_DAL:$TotalLedVchAmt)
	0022 	: Set : IsSelected_Cl    		: (NOT $$IsEmpty:##SelectedLines_NetAmt)
		


[Field: SelectedLineTotal_DebitAmt]
	Use     : Name Field
	Set as  : if ##IsSelected_Dr AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollDebitTotal_DAL:$TotalLedDrVchAmt) Then $$String:@SelectedTotalDr + $$String:@SelectedTotalValDr Else ""
	;Background         : if ##IsSelected_Dr AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollDebitTotal_DAL:$TotalLedDrVchAmt) Then  "Light Blue" Else "White"

;	Color   : Blue

	;Invisible          : NOT ##IsLedgerReport OR NOT $$InDisplayMode
	Invisible          : NOT $$InDisplayMode
	
	SelectedTotalDr    : $$LocaleString:"Debit Total : "
	SelectedTotalValDr : $$String:##SelectedLines_DrTotal:"DrCr"
	
	Width   : 28
	Align   : Centre

		
[Field:SelectedLineTotal_CreditAmt]
	Use     : Name Field
	Set as  : if ##IsSelected_Cr AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollCreditTotall_DAL:$TotalLedCrVchAmt) Then $$String:@SelectedTotalCr + $$String:@SelectedTotalValCr Else ""

	;Background         : if ##IsSelected_Cr AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollCreditTotall_DAL:$TotalLedcrVchAmt) Then "Yellow" Else "White"

	Color   : Blue
	
	;Invisible          : NOT  ##IsLedgerReport OR NOT $$InDisplayMode
	Invisible          : NOT $$InDisplayMode
	
	SelectedTotalCr    : $$LocaleString:"Credit Total : "
	SelectedTotalValCr : $$String:##SelectedLines_CrTotal:"DrCr"
	
	Width   : 28
	Align   : Centre

		
[Field: SelectedLineTotal_Closing]
	Use     : Name Field
	Set as  : if ##IsSelected_Cl AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollNetAmt_DAL:$TotalLedVchAmt) Then $$String:@SelectedTotalnet + $$String:@SelectedTotalValnet Else ""

	;Background   : if ##IsSelected_Cl AND NOT $$IsEmpty:($$ReportObject:$$CollAmtTotal:CollNetAmt_DAL:$TotalLedVchAmt) Then "Red" Else "White"
	
	Color   : Red

	Format  : "DrCr"
	
	;Invisible          : NOT  ##IsLedgerReport OR NOT $$InDisplayMode
	Invisible          : NOT $$InDisplayMode
	
	SelectedTotalNet   : $$LocaleString:"Closing: "
	SelectedTotalValNet: $$String:##SelectedLines_NetAmt:"DrCr"
	
	Width   : 28
	Align   : Centre

		
[Collection:CollNetAmt_DAL]
	Data Source : Report : Selected
	Fetch       : Name, TotalLedVchAmt,DaybookAmount
	Client Only : Yes
		
[Collection:CollDebitTotal_DAL]
	Data Source : Report : Selected
	Fetch       : Name,TotalLedDrVchAmt,DaybookAmount
    Client Only : Yes
	
	Filter 		: IsSelected_DebitBal_DAL
		
[System:Formulae]
    IsSelected_DebitBal_DAL : $$IsDr:$TotalLedVchAmt
	
[Collection:CollCreditTotall_DAL]
	Data Source : Report : Selected
	Fetch       : Name, TotalLedCrVchAmt,DaybookAmount
    Client Only : Yes
	
	Filter 		: IsSelected_CreditBal_DAL
		
[System:Formulae]
	IsSelected_CreditBal_DAL : NOT $$isDr:$TotalLedVchAmt
		
[Variable:SelectedLines_DrTotal]
	Type		: Amount
	Persistent  : Yes
		
[Variable:SelectedLines_CrTotal]
	Type 		: Amount
	Persistent  : Yes
		
[Variable:SelectedLines_NetAmt]
	Type 		: Amount
	Persistent 	: Yes
		
[Variable:IsSelected_Dr]
	Type 		: Logical
		
[Variable:IsSelected_Cr]
	Type 		: Logical
		
[Variable:IsSelected_Cl]
	Type 		: Logical
		
[Variable:SelectedLines_NoofLine]
	Type 		: Number
	Persistent 	: Yes
	
[System:Variables]
    SelectedLines_NoofLine : 0
	SelectedLines_DrTotal : 0
	SelectedLines_CrTotal : 0
	SelectedLines_NetAmt  : 0
	
    IsSelected_Dr     	 : NO
    IsSelected_Cr     	 : NO
	IsSelected_Cl    	 : NO
	